<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>卓越网络管理系统</title>
<link rel="stylesheet" type="text/css" href="js/ext-3.0.3/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="scripts/hxcy/hxcy-main.css" />
<script type="text/javascript" src="js/ext-3.0.3/adapter/ext/ext-base.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/ext-3.0.3/ext-all.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/ext-3.0.3/source/locale/ext-lang-zh_CN.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/ext-3.0.3/ux/ux-all.js" charset="UTF-8"></script> 
<script type="text/javascript" src="scripts/hxcy/hxcy-util.js" charset="UTF-8"></script>
<script type="text/javascript" src="scripts/hxcy/hxcy-cmp.js" charset="UTF-8"></script>
<!-- <script type="text/javascript" src="fgys/s/Message.js" charset="UTF-8"></script>
<script type="text/javascript" src="fgys/s/showMessage.js" charset="UTF-8"></script>
 -->
<script type="text/javascript" charset="UTF-8"><!--
	/*Ext.onReady(function(){//从后台获取权限
		Ext.Ajax.request({
			url:Hxcy.CPT+"/account/menuJson.action",
			method:'GET',
			success:function(rs){
				var rst = Ext.decode(rs.responseText);
			}
		});*/
	/**
	 * 退出系统
	 */
	function logout() {
		Ext.Msg.confirm('确认', "确定要退出系统吗?", function (btn) {
			if (btn == "yes") {
				window.location="account/logout!logout.action";
			}
		});
	}
	
	/**
	* 模拟权限集合
	*/
	var menuItems=[
     	  {"id":"ts","keyword":"TOUSU","title":"投诉管理","style":"TOUSU","url":"ts-main.jsp","menus":[]},
     	  {"id":"gc","keyword":"GONGCHENG","title":"工程管理","style":"GONGCHENG","url":"gc-main.jsp","menus":[
     	  	  {"id":"gc-fgys","keyword":"GC-FGYS","title":"覆盖延伸建设","menus":[
               {"id":"gc-fgys-xjxm","keyword":"GC-FGYS-XJ","title":"新建项目","url":"/login.jsp","style":"veh-icon-7"}
               ]},                         	  
     		 {"id":"gc-jz","keyword":"GC-JZ","title":"基站建设","menus":[
     		  {"id":"gc-jz-xjxm","keyword":"GC-JZ-XJ","title":"新建项目","url":"/login.jsp","style":"veh-icon-7"}
     		  ]},
     		  {"id":"gc-yh","keyword":"GC-YH","title":"优化建设","menus":[
        		  {"id":"gc-yh-xjxm","keyword":"GC-JZ-YH","title":"新建项目","url":"/login.jsp","style":"veh-icon-7"}
        		]} 
     	  ]},
     	 {"id":"pc","keyword":"PUCHA","title":"普查管理","style":"PUCHA","url":"pc-main.html","menus":[]},
     	  {"id":"qyw","keyword":"QUANYEWU","title":"全业务管理","style":"QUANYEWU","url":"qyw-main.html","menus":[]},
     	  {"id":"wy","keyword":"WUYE","title":"物业管理","style":"WUYE","url":"wy.html","menus":[]}
     	  ];
	/**
	 * 一级菜单的获取
	 */
	function getOneMenu(menuItems){
		var oneMenu='';
		if(menuItems.length>0){
			for(var i=menuItems.length-1;i>=0;i--){
				oneMenu+='<a id="'+menuItems[i].id+'" class="'+menuItems[i].style+'" href="'+menuItems[i].url+'"></a>';
			}
		}else{
			oneMenu='';
		}
		return oneMenu;
	}
	
	/**
	*根据一级菜单获取子集合
	*/
	function getTwoMenu(id){
		var navItemsJson=[];
		if(menuItems.length>0){
			for(var i=0;i<menuItems.length;i++){
				if(menuItems[i].id==id){
					navItemsJson=menuItems[i].menus.concat();//复制一个数组
					break;
				}
			}
		}
		return navItemsJson;
	}
	
	
	 /*
		 * 覆盖延伸内容显示加载(IFRAME)
		 */
		Hxcy.main.fgys.IFrame = {
			create: {
				id: 'iframe-fgys-1',
				closable: true,
				title: '新建项目 ',
				xtype: 'iframe',
				url: '/room/roomProject!createProject.action'
			},
			find: {
				id: 'iframe-fgys-2',
				closable: true,
				title: "项目查询",
				xtype: 'iframe',
				url: '/fgys/list.html'
			},
			tsxqqr: {
				id: 'iframe-fgys-tsxqqr',
				closable: true,
				title: "投诉需求确认",
				xtype: 'iframe',
				url:"/fgys/fgys_dbAndybproject.jsp?activity=投诉需求确认"
			},
			qqmpcs: {
				id: 'iframe-fgys-qqmpcs',
				closable: true,
				title: "前期摸排测试",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=前期摸排测试"
			},
			wlbsh:{
				id:'iframe-fgys-wlbsh',
				closable: true,
				title: "网络部审核",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=网络部审核"
			},
			fgsqr:{
				id:'iframe-fgys-fgsqr',
				closable: true,
				title: "分公司确认",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=分公司确认"
			},
			gcblx:{
				id:'iframe-fgys-gcblx',
				closable: true,
				title: "工程部立项",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=工程部立项"
			},
			fgysfasj:{
				id:'iframe-fgys-fgysfasj',
				closable: true,
				title: "覆盖延伸方案设计",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=覆盖延伸方案设计"
			},
			fgysfash:{
				id:'iframe-fgys-fgysfash',
				closable: true,
				title: "覆盖延伸方案审核",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=覆盖延伸方案审核"
			},
			csfasj:{
				id:'iframe-fgys-csfasj',
				closable: true,
				title: "传输方案设计",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=传输方案设计"
			},
			csfash:{
				id:'iframe-fgys-csfash',
				closable: true,
				title: "传输方案审核",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=传输方案审核"
			},
			cssgsh:{
				id:'iframe-fgys-cssgsh',
				closable: true,
				title: "传输施工审核",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=传输施工审核"
			},
			tj:{
				id:'iframe-fgys-tj',
				closable: true,
				title: "提交土建图纸",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=提交土建图纸"
			},
			kgsq:{
				id:'iframe-fgys-kgsq',
				closable: true,
				title: "开工申请",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=开工申请"
			},

			kgpf:{
				id:'iframe-fgys-kgpf',
				closable: true,
				title: "开工批复",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=开工批复"
			},
			cskgsq:{
				id:'iframe-fgys-cskgsq',
				closable: true,
				title: "传输开工申请",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=传输开工申请"
			},
			cskgpf:{
				id:'iframe-fgys-cskgpf',
				closable: true,
				title: "传输开工批复",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=传输开工批复"
			},
			cssg:{
				id:'iframe-fgys-cssg',
				closable: true,
				title: "传输施工",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=传输施工"
			},
			tjsg:{
				id:'iframe-fgys-tjsg',
				closable: true,
				title: "土建施工",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=土建施工"
			},
			tjwg:{
				id:'iframe-fgys-tjwg',
				closable: true,
				title: "土建完工",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=土建完工"
			},
			bxsg:{
				id:'iframe-fgys-bxsg',
				closable: true,
				title: "布线施工",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=布线施工"
			},
			bxwg:{
				id:'iframe-fgys-bxwg',
				closable: true,
				title: "布线完工",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=布线完工"
			},
			sbaz:{
				id:'iframe-fgys-sbaz',
				closable: true,
				title: "设备安装",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=设备安装"
			},
			sqcsdl:{
				id:'iframe-fgys-sqcsdl',
				closable: true,
				title: "申请传输电路",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=申请传输电路"
			},
			zdkt:{
				id:'iframe-fgys-zdkt',
				closable: true,
				title: "站点开通",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=站点开通"
			},
			tjys:{
				id:'iframe-fgys-tjys',
				closable: true,
				title: "提交验收",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=提交验收"
			},
			wgys:{
				id:'iframe-fgys-wgys',
				closable: true,
				title: "完工验收",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=完工验收"
			},
			whyh:{
				id:'iframe-fgys-whyh',
				closable: true,
				title: "维护优化",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=维护优化"
			},
			wlyh:{
				id:'iframe-fgys-wlyh',
				closable: true,
				title: "网络优化",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=网络优化"
			},
			yszg:{
				id:'iframe-fgys-yszg',
				closable: true,
				title: "验收整改",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=验收整改"
			},
			yhys:{
				id:'iframe-fgys-wlys',
				closable: true,
				title: "优化验收",
				xtype: 'iframe',
				url: "/fgys/fgys_dbAndybproject.jsp?activity=优化验收"
			},
			dictionary: {
				id: 'iframe-fgys-5',
				closable: true,
				title: "数据字典",
				xtype: 'iframe',
				url: "/system/dictionary.action"
			},
			userManager: {
				id: 'iframe-fgys-6',
				closable: true,
				title: "用户管理",
				xtype: 'iframe',
				url: "/account/listUser.action"
			},
			security: {
				id: 'iframe-fgys-7',
				closable: true,
				title: "角色管理",
				xtype: 'iframe',
				url:"/account/listRole.action"
			},
			menuManager: {
				id: 'iframe-fgys-8',
				closable: true,
				title: "菜单管理",
				xtype: 'iframe',
				url: "/menu/menuManager.action"
			},
			resourceManager: {
				id: 'iframe-fgys-9',
				closable: true,
				title: "资源管理",
				xtype: 'iframe',
				url: "/account/listResource.action"
			}
		};

	Hxcy.main.Nav=function(){
		 var navMenu=[{
				id: 'h-fgys-menu',
				title : '覆盖延伸建设',
				keyword:'GC-FGYS',//权限标示
				defaults : {
					xtype : 'Hxcyboxbutton'
				},
				items: [{
						text:'新建项目 ',
						iconCls:'veh-icon-10',
						keywrod:'GC-FGYS-XJ',
						handler: function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.create);
						}
					}, {
						text: '项目查询',
						iconCls: 'veh-icon-22',
						handler: function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.find);
						}
					}, {
						text: '投诉需求确认',
						iconCls: 'veh-icon-9',
						handler: function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.tsxqqr);
						}
					}, {
						text: '前期摸排测试',
						iconCls: 'veh-icon-18',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.qqmpcs);
						}
					}, {
						text:'网络部审核',
						iconCls: 'veh-icon-20',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.wlbsh);
						}
					}, {
						text:'分公司确认',
						iconCls: 'veh-icon-9',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.fgsqr);
						}
					}, {
						text:'工程部立项',
						iconCls: 'sys-icon-06',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.gcblx);
						}
					}, {
						text:'覆盖延伸方案设计',
						iconCls: 'sys-icon-07',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.fgysfasj);
						}
					}, {
						text:'覆盖延伸方案审核',
						iconCls: 'sys-icon-08',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.fgysfash);
						}
					}, {
						text:'传输方案设计',
						iconCls: 'sys-icon-09',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.csfasj);
						}
					}, {
						text:'传输方案审核',
						iconCls: 'sys-icon-010',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.csfash);
						}
					}, {
						text:'传输施工审核',
						iconCls: 'sys-icon-011',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.cssgsh);
						}
					}, {
						text:'提交土建图纸',
						iconCls: 'sys-icon-012',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.tj);
						}
					}, {
						text:'开工申请',
						iconCls: 'sys-icon-013',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.kgsq);
						}
					},  {
						text:'开工批复',
						iconCls: 'sys-icon-014',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.kgpf);
						}
					}, {
						text:'传输开工申请',
						iconCls: 'sys-icon-015',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.cskgsq);
						}
					}, {
						text:'传输开工批复',
						iconCls: 'sys-icon-016',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.cskgpf);
						}
					}, {
						text:'传输施工',
						iconCls: 'sys-icon-017',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.cssg);
						}
					},{
						text:'土建施工',
						iconCls: 'sys-icon-018',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.tjsg);
						}
					},{
						text:'土建完工',
						iconCls: 'sys-icon-019',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.tjwg);
						}
					},{
						text:'布线施工',
						iconCls: 'sys-icon-020',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.bxsg);
						}
					},{
						text:'布线完工',
						iconCls: 'sys-icon-021',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.bxwg);
						}
					},{
						text:'设备安装',
						iconCls: 'sys-icon-022',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.sbaz);
						}
					},{
						text:'申请传输电路',
						iconCls: 'sys-icon-023',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.sqcsdl);
						}
					},{
						text:'站点开通',
						iconCls: 'sys-icon-024',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.zdkt);
						}
					},{
						text:'提交验收',
						iconCls: 'sys-icon-025',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.tjys);
						}
					},{
						text:'完工验收',
						iconCls: 'sys-icon-026',
						handler:function(){
							Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.wgys);
						}
					},{
						text: '维护优化',
						iconCls: 'sys-icon-027',
						handler:function(){
						Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.whyh);
					  }
					},{
						text: '网络优化',
						iconCls: 'sys-icon-028',
						handler:function(){
						Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.wlyh);
					  }
					},{
						text: '验收整改',
						iconCls: 'sys-icon-029',
						handler:function(){
						Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.yszg);
					  }
					},{
						text: '优化验收',
						iconCls: 'sys-icon-030',
						handler:function(){
						Hxcy.CmpMgr.showTab(Hxcy.main.fgys.IFrame.yhys);
					  }
					}]
				},{
					id : 'h-site-menu',
					title : '基站建设',
					keyword:'GC-JZ',
					defaults : {
						xtype : 'Hxcyboxbutton'
					},
					items : [{
						text:'新建项目 ',
						iconCls:'veh-icon-7',
						handler: function(){
							Hxcy.CmpMgr.showTab();
						}
					}, {
						text: '项目查询',
						iconCls: 'veh-icon-8',
						handler: function(){
							Hxcy.CmpMgr.showTab();
						}
					}, {
						text: '待处理任务',
						iconCls: 'veh-icon-9',
						handler: function(){
							Hxcy.CmpMgr.showTab();
						}
					}, {
						text: '已处理任务',
						iconCls: 'veh-icon-10',
						handler:function(){
							Hxcy.CmpMgr.showTab();
						}
					}, {
						text: '数据字典',
						iconCls: 'veh-icon-11',
						handler:function(){
							Hxcy.CmpMgr.showTab();
					  	}
					}]	
				}, {
					id : 'h-youhua-menu',
					title : '优化建设',
					keyword:'GC-YH',
					defaults :{
						xtype : 'Hxcyboxbutton'
					},
					items:[{
						text : '新建项目',
						iconCls : 'veh-icon-7',
						handler : function(){
							
						}
					}]
				}
		 ];
		var menus=[];
		for(var i=0;i<menuItems.length;i++){
			if(menuItems[i].keyword=='GONGCHENG'){
				menus=menuItems[i].menus.concat();//根据一级菜单权限获取二，三级
				break;
			}
		}
		//如果没有工程管理权限就没有二，三级权限
		/*if(menus.length==0){
			navMenu=[];			
		}else{
			for(var i=0;i<navMenu.length;i++){
				if(navMenu[i].keyword==menus[i].keyword){
					for(var j=0;i<navMenu[i].items.length;j++){
						if(navMenu[i].items[j].keyword==menus[i].menus[j].keyword){
						}else{
							delete navMenu[i].items[j];
						}
					}
				}else{
					delete navMenu[i];
				}
			}
		}*/
		var exit = {
				id : 'exit',
				iconCls : 'veh-icon-30',
				text : '退出系统',
				handler : function() {
					Ext.Msg.confirm('确认', "<br />&nbsp;&nbsp;确认退出系统?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", function(btn) {
						if (btn == "yes") {// 确认提交
							window.location=Hxcy.CPT + '/public/exitMain.action';
						}
					});
				}
			}
		 if(navMenu.length==0){
			navMenu.push({
				id : 'v-has-no-auth',
				title : '没有权限',
				defaults : {
					xtype : 'Hxcyboxbutton'
				},
				items : [exit]
			});
		} else {
			navMenu[navMenu.length-1].items.push(exit);
		}

		return {
			navMenu : navMenu
		}
	}();

	/*
	 * 覆盖延伸布局面板(北，南，西，中，东)
	 */
	Hxcy.main.Panel = {
		north: {
			id: "toolBar",
			region : 'north',
			cls : 'banner-class banner-class-vhc',
			html : '<div class="banner" style="float:right;margin:0px 5px;">'+getOneMenu(menuItems)+'</div>',
			margins : '5 5 5 5',
			height : 72
		},
		south : {
			id : "statusBar",
			region : 'south',
			height : 25,
			margins : '5 5 5 5',
			items : {
				xtype : "statusbar",
				defaultText : "卓越网络工程管理系统",
				defaultIconCls : "x-status-default-icon",
				busyText : "正在加载数据...",
				items : ['<img src="scripts/hxcy/images/016.gif"></img>  管理员   [设置]  '+
				         '<a href="#" onclick="javascript:logout()" style="text-decoration:none;">[注销 ]</a>'
						]
			}
		},
		west : {
			id : 'nav',
			region : 'west',
			split : true,
			layout : 'accordion',
			cls : 'accordion-button',
			width : '15%',
			minSize : 110,
			maxSize : 200,
			margins : '0 0 0 5',
			layoutConfig : {
				animate : true
			},
			defaults : {
				border : false,
				iconCls : 'x-accordion-item',
				autoScroll : true
			},
			items : Hxcy.main.Nav.navMenu
		},
		center : {
			id : 'contentWrapper',
			layoutOnTabChange : true,// 这个选项怎样形容重要都不会过
			xtype : 'hxcytabpanel',
			defaults : {
				border : false,
				bodyBorder : false
			},
			activeItem : 0,
			region : 'center',
			title : "内容列表",
			margins : "0 5 0 0",
			plugins : new Ext.ux.TabCloseMenu(),
			items : [{
				title: '工作台 ',
				closable: false,
				html:'<img border="0" width="100%" height="100%" src="scripts/hxcy/images/welcome.jpg"'+' />'
			}]
		}
	};
	
	Ext.onReady(function(){
		var viewport=new Ext.Viewport({
		layout:'border',
		items: [
				Hxcy.main.Panel.north,
				Hxcy.main.Panel.south,
				Hxcy.main.Panel.west,
				Hxcy.main.Panel.center
			]
		});
		alert(menuItems[1].menus.length);
	});
--></script>
</head>
<body>
</body>
</html>